<?php
class Utils_Guids
{
    protected $_guid_table;
    
    public function __construct()
    {
          $this->_guid_table = new Zend_Db_Table('guids');
    }
    
    public function guidToClass( $GUID)
    {
          $Row = $this->_guid_table->fetchRow(  $this->_guid_table->select()->where('GUID = ?', $GUID)  );
          if (!$Row) return false;
          return $Row->ClassName;
    }
    
    public function classToGuid( $Class)
    {
          $Row = $this->_guid_table->fetchRow(  $this->_guid_table->select()->where('ClassName = ?', $Class)  );
          if (!$Row) return false;
          return $Row->GUID;
    }
    
    public function addClass( $Class)
    {
          $Row = $this->_guid_table->createRow();
          $Row->ClassName = $Class;
          $Row->GUID = md5(time());
          $Row->save();
    }
    
}